﻿@{

    Layout = null;

    List<YQGL.Model.DM_QYBB> YBQYBBList = ViewData["YBQYBBList"] == null ? new List<YQGL.Model.DM_QYBB>() : ViewData["YBQYBBList"] as List<YQGL.Model.DM_QYBB>;

    List<YQGL.Model.DM_QYBB> JBQYBBList = ViewData["JBQYBBList"] == null ? new List<YQGL.Model.DM_QYBB>() : ViewData["JBQYBBList"] as List<YQGL.Model.DM_QYBB>;


    List<YQGL.Model.DM_QYBB> NBQYBBList = ViewData["NBQYBBList"] == null ? new List<YQGL.Model.DM_QYBB>() : ViewData["NBQYBBList"] as List<YQGL.Model.DM_QYBB>;

    List<YQGL.Model.DM_QYBB> FJQYBBList = ViewData["FJQYBBList"] == null ? new List<YQGL.Model.DM_QYBB>() : ViewData["FJQYBBList"] as List<YQGL.Model.DM_QYBB>;

    List<YQGL.Model.SB_QYBB> SBQYBBList = ViewData["SBQYBBList"] == null ? new List<YQGL.Model.SB_QYBB>() : ViewData["SBQYBBList"] as List<YQGL.Model.SB_QYBB>;
}
@model DateTime


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>企业报表</title>

    <!-- Bootstrap framework -->
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css" />
    <!-- jQuery UI theme -->
    <link rel="stylesheet" href="/lib/jquery-ui/css/Aristo/Aristo.css" />
    <!-- tooltips-->
    <link rel="stylesheet" href="/lib/jBreadcrumbs/css/BreadCrumb.css" />
    <!-- tooltips-->
    <link rel="stylesheet" href="/lib/qtip2/jquery.qtip.min.css" />
    <!-- colorbox -->
    <link rel="stylesheet" href="/lib/colorbox/colorbox.css" />
    <!-- code prettify -->
    <link rel="stylesheet" href="/lib/google-code-prettify/prettify.css" />
    <!-- sticky notifications -->
    <link rel="stylesheet" href="/lib/sticky/sticky.css" />
    <!-- aditional icons -->
    <link rel="stylesheet" href="/img/splashy/splashy.css" />
    <!-- flags -->
    <link rel="stylesheet" href="/img/flags/flags.css" />
    <!-- datatables -->
    <link rel="stylesheet" href="/lib/datatables/extras/TableTools/media/css/TableTools.css">


    <!-- main styles -->
    <link rel="stylesheet" href="/css/style.css" />
    <!-- theme color-->
    <link rel="stylesheet" href="/css/blue.css" id="link_theme" />

    <!--<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
    -->
    <!-- favicon -->
    <link rel="shortcut icon" href="/favicon.ico" />
    <link rel="stylesheet" href="/css/bootstrap-dropselect.css" />
    <!--[if lte IE 8]>
    <link rel="stylesheet" href="/css/ie.css"/>
    <![endif]-->
    <!--[if lt IE 9]>
    <script src="/js/ie/html5.js"></script>
    <script src="/js/ie/respond.min.js"></script>
    <script src="/lib/flot/excanvas.min.js"></script>
    <![endif]-->
    <script src="/js/jquery.min.js"></script>
    <script src="/js/jquery.actual.min.js"></script>
    <script src="/lib/validation/jquery.validate.js"></script>
    <script src="/bootstrap/js/bootstrap.min.js"></script>
    <script src="@Url.Content("~/Scripts/json2.js")" type="text/javascript"></script>

    <style type="text/css">
        table.table-bordered th {
            text-align: center;
        }

        table.table-bordered td {
            text-align: center;
        }
    </style>
    <script type="text/javascript">

    $(document).ready(function () {

        $("#btnPub").click(function () {
            var that = this;
            $(this).attr("disabled", "disabled");
            $.ajax({
                type: "POST",
                url: '@Url.Content("~/QYBB/Save")',
                data: $('#form1').serialize(),
                error: function (data) {
                    alert(data);
                    $(that).removeAttr("disabled");
                },
                success: function (data) {
                    alert(data);

                    $(that).removeAttr("disabled");

                    if (data == "操作成功") {

                        $.ajax({
                            type: "POST",
                            url: '@Url.Action("QYBBPartial", "QYBB")',
                            data: { YM: $("#hdYearAndMonth").val() },
                            success: function (data) {

                                if (data.split(':')[0] == "Failed") {
                                    alert(data.split(':')[1]);
                                }
                                else {


                                    $("#QYBBContent").html(data);
                                }

                            }
                        });
                    } else {

                    }
                }

            });


        });


    })

    function ValueChange(obj) {

        var selectProp = obj.value;

        if (typeof (selectProp) != "undefined" & selectProp != "") {

            $("#hdYearAndMonth").val(selectProp);
            $.ajax({
                type: "POST",
                url: '@Url.Action("QYBBPartial", "QYBB")',
                data: { YM: selectProp },
                success: function (data) {

                    if (data.split(':')[0] == "Failed") {
                        alert(data.split(':')[1]);
                    }
                    else {


                        $("#QYBBContent").html(data);
                    }

                }
            });

        }
    }
         function doBack()
         {


          window.location.href = '@Url.Action("Index", "QYBB")';
        }

    </script>
</head>
<body>

    @using (Html.BeginForm("Save", "QYBB", FormMethod.Post, new { id = "form1", enctype = "multipart/form-data" }))
    {
        <div style="max-width:1000px;margin-left:auto;margin-right:auto">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title"><button type="button" class="btn btn-info btn-sm pull-Left" onclick=" doBack()" id="btnBack" name="btnBack">返回</button> &nbsp; &nbsp;企业报表填写<button type="button" class="btn btn-success btn-sm pull-right" id="btnPub" name="btnPub">保存</button> </h3>
                </div>
                <div class="panel-body">
                    <div class="alert alert-info" role="alert">
                        <strong>企业名称：</strong>@ViewData["Nsrmc"]
                        <br />
                        <strong>报表所属时间：</strong>   @Model.ToString("yyyy年MM月") &nbsp;&nbsp;
                        <strong> 企业分类：</strong>@ViewData["DLMC"]  &nbsp;,
                        @ViewData["LXMC"]  <span class="text-primary pull-right">当前登录用户：@ViewData["LoginID"]</span>



                    </div>
                    @*<table border="0" cellpadding="0" cellspacing="0">
                        <tr>

                            <td style="width:90px;">
                                <div class="alert alert-success" role="alert" style="white-space:nowrap;">
                                    填报月份：
                                </div>
                            </td>

                            <td style="width:140px;vertical-align:top;">
                                @Html.DropDownList("selMonthList", ViewData["MonthList"] as List<SelectListItem>, "--请选择--", new { @class = "form-control pull-right", @style = "width:130px;height:35px;", @onchange = "ValueChange(this)" })


                            </td>
                            <td style="width:700px;"></td>
                        </tr>
                    </table>*@



                    <div style="padding:0px;margin:0px;" id="QYBBContent">
                    @Html.Partial("QYBBPartial", Model)

                </div>
            </div>
        </div>
    </div>

        @Html.Hidden("hdYearAndMonth", ViewData["YearAndMonth"]);


    }
    </body>
    </html>
